<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            padding:0;
            margin:0;
        }
        .one{
            width: 300px;
            height: 300px;
            background: red;
        }
        #two{
            width: 100px;
            height: 100px;
            background: green;
        }
    </style>
</head>
<body>
    <div class="one"></div>
    <div class="one"></div>
    <div id="two"></div>
</body>
<script>
    // offsetTop
    console.log(document.querySelector("#two").offsetTop);// 600
</script>
</html>